<template>
    <div class="gap">
      <h3>增加保险种类</h3>

      <el-form :model="category" status-icon ref="category" label-width="70px" class="demo-category">
       
        <el-form-item label="名字">
          <el-input type="text" v-model="category.categoryName" max="250px"></el-input>
        </el-form-item>


        <el-form-item>
          <el-button type="primary" @click="addcategory1">增加保险产品</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>


<script>

import axios from "axios";
import Category from "./Cascader.vue";
import { createNamespacedHelpers } from "vuex";
const { mapState, mapActions } = createNamespacedHelpers("productcategory");

export default {
    components: {
    Category,
  },
  data() {
    return {
      category:{
        categoryName:"",
      }
    }
  },
  methods: {
    ...mapActions(["addcategory",]),
     async addcategory1() {
      const data = await this.addcategory(this.category);
      if (data.status) {
        this.$router.push("/system/categorylist");
      }
    },
  },
}
</script>

<style lang="scss" scoped>
  h3{
    line-height: 60px;
  }
</style>